package com.qf.sy2103.fmmall.api.controller;

import com.qf.sy2103.common.vo.ResultVO;
import com.qf.sy2103.fmmall.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    ProductService productService;

    @GetMapping("/detail-info/{pid}")
    public ResultVO detailInfo(@PathVariable("pid") Integer pid ){

        return productService.detailInfo(pid) ;
    }


    @GetMapping("/detail-params/{pid}")
    public ResultVO detailParams(@PathVariable("pid") Integer pid ){

        return productService.detailParams(pid);
    }

    @GetMapping("/detail-commonts/{pid}")
    public ResultVO detailCommonts(@PathVariable("pid") Integer pid ,Integer pageNum, Integer limit){

        return productService.detailCommonts(pid,pageNum,limit);
    }

    @GetMapping("/detail-commontscount/{pid}")
    public ResultVO detailCommontscount(@PathVariable("pid") Integer pid ){

        return productService.detailCommontscount(pid);
    }

}
